package myapps.ttclient.protocol.message;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

import myapps.ttclient.Helper;
import myapps.ttclient.baseclass_and_interface.TTClientMessage;

public class RSAPublicKeyServerMessage extends TTClientMessage
{
	public byte[] modulus;
	public byte[] exponent;
	
	public RSAPublicKeyServerMessage(byte[] modulus, byte[] exponent)
	{
		this.modulus = modulus;
		this.exponent = exponent;
	}
	
	public static TTClientMessage parse(DataInputStream dis) throws IOException
	{	
		byte[] modulus = Helper.ParseAsByteArray(dis);
		
		byte[] exponent = Helper.ParseAsByteArray(dis);
		
		return new RSAPublicKeyServerMessage(modulus, exponent);
	}
	
	@Override
	public void toDataOutputStream(DataOutputStream dos) throws IOException
	{
		throw new IOException("NotImplementedException");
	}
}
